<template>
    <div>
        数字一：{{ number1 }}
    </div>
    <div>
        数字二：{{ number2 }}
    </div>
    <button @click="addNumber"> +1 </button>
    <button @click="jianNumber"> -1 </button>
</template>

<script setup>
import { ref } from 'vue'
// 加法功能
const number1 = ref(0) // 定义变量
const addNumber = () => {  // 定义函数
    number1.value++;
}

// 减法功能
const number2 = ref(0);
const jianNumber = () => {
    number2.value--;
}
</script>